RM = rm
CC = gcc
CFLAGS = -Wall
INCLUDES = 
LFLAGS =
LIBS = -lm -lstdc++
SRCS = $(shell find . -name '*.cpp')
OBJS = $(SRCS:.cpp=.o)

UNAME = $(shell uname -s)

ifneq (,$(findstring MINGW,$(UNAME)))
    X = .exe
endif
ifneq (,$(findstring CYGWIN,$(UNAME)))
    X = .exe
endif

MAIN = scrunch$(X)

.PHONY: depend clean

all:		$(MAIN)
			@echo Done

$(MAIN):	$(OBJS)
			echo $(OBJS)
			$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)

.cpp.o:
			$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

clean:
			$(RM) $(OBJS) $(MAIN)

depend: $(SRCS)
			makedepend $(INCLUDES) $^
